//
//  SettingViewController.m
//  LoveBeeProject
//
//  Created by 沈腾飞 on 2017/1/5.
//  Copyright © 2017年 斯芬克斯. All rights reserved.
//

#import "SettingViewController.h"
#import "AboutViewController.h"
#import "RenewViewController.h"

@interface SettingViewController () <UITableViewDataSource>

@end

static NSString * cellID = @"cell_ID";

@implementation SettingViewController {
    
    NSArray * _listArr;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.view.backgroundColor = [UIColor cz_randomColor];
    
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:cellID];
    _listArr = @[@"关于爱鲜蜂",@"版本更新"];
    
    //去除cell下面的分割线  方法一
    self.tableView.tableFooterView = [[UIView alloc] init];
    //去除cell下面的分割线  方法二 (会把分割线给隐藏掉)
//    self.tableView.separatorStyle = NO;
    
    
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return _listArr.count;
    
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
    
    if (indexPath.row == 0) {
        cell.textLabel.text = _listArr[0];
        cell.textLabel.textColor = [UIColor redColor];
    } else {
        cell.textLabel.text = _listArr[1];
        cell.textLabel.textColor = [UIColor blueColor];
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.row == 0) {
        AboutViewController * vc = [[AboutViewController alloc] init];
        [self.navigationController pushViewController:vc animated:YES];
        
    } else {
        RenewViewController * vc = [[RenewViewController alloc] init];
        [self.navigationController pushViewController:vc animated:YES];
    }
    
}

- (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
